package apiday03;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;

/**
 * 集合转为数组
 */
public class CollectionToArrayDemo {
    public static void main(String[] args) {
        Collection<String> c = new ArrayList<>();
        c.add("1");
        c.add("2");
        c.add("3");
        String[] a = c.toArray(new String[3]);
        System.out.println(Arrays.toString(a));
    }
}
